﻿View = require './../view'
mediator = require 'mediator'

module.exports = class MyListItemView extends View
	tagName: 'li'
	itemNamePrefix: null

	SetSelectedItemChangedEventName:( name)->
		console.debug 'SetSelectedItemChangedEventName', name
		itemName = @itemNamePrefix + @model.id
		@delegate 'click', ()=>  mediator.publish name, @model

	initialize:(itemNamePrefix) ->
		console.debug 'MyListItemView#initialize', itemNamePrefix
		@itemNamePrefix = itemNamePrefix
		super
	
	render: ->
		console.debug 'MyListItemView#render', this, @$el
		
		super
	
	afterRender: ->
		console.debug 'MyListItemView#afterRender'
		super